﻿<UserControl x:Class="DotNetSimaticDatabaseProtokollerConfigurationTool.Windows.EditStorages"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:DotNetSimaticDatabaseProtokollerLibrary="clr-namespace:DotNetSimaticDatabaseProtokollerLibrary;assembly=JFK-ProtokollerLibrary"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" 
             d:DesignHeight="427" d:DesignWidth="508">
    <Grid>
        <Button Content="Add CSV Storage" Margin="0,12,12,0" Height="25" VerticalAlignment="Top" HorizontalAlignment="Right" Width="147" Name="cmdAddCSVStorage" Click="cmdAddCSVStorage_Click" />
        <Button Content="Add SQLite Storage" HorizontalAlignment="Right" Margin="0,43,12,0" Width="147" Height="25" VerticalAlignment="Top" Name="cmdAddSQLiteStorage" Click="cmdAddSQLiteStorage_Click" />
        <Button Content="Add MsSQL Storage" HorizontalAlignment="Right" Margin="0,167,12,0" Width="147" Height="25" VerticalAlignment="Top" Name="cmdAddMsSQLStorage" Click="cmdAddMsSQLStorage_Click" Visibility="Visible" IsEnabled="True" />
        <Button Content="Add PostgreSQL Storage" HorizontalAlignment="Right" Margin="0,136,12,0" Width="147" Height="25" VerticalAlignment="Top" Name="cmdAddPostgreSQLStorage" Click="cmdAddPostgreSQLStorage_Click" Visibility="Visible" />
        <Button Content="Add MySQL Storage" HorizontalAlignment="Right" Margin="0,105,12,0" Width="147" Height="25" VerticalAlignment="Top" Name="cmdAddMySQLStorage" Click="cmdAddMySQLStorage_Click" Visibility="Visible" />
        <Button Content="Add ODBC Storage" HorizontalAlignment="Right" Margin="0,198,12,0" Width="147" Height="25" VerticalAlignment="Top" Name="cmdAddODBCStorage" Click="cmdAddODBCStorage_Click" Visibility="Visible" IsEnabled="False" />
        <Button Content="Remove" HorizontalAlignment="Right" Margin="0,0,12,12" Name="cmdRemoveConnection" Width="147" Height="25" VerticalAlignment="Bottom" Click="cmdRemoveConnection_Click" />
        <Grid Margin="12,12,165,12" Name="grid1">
            <Grid.RowDefinitions>
                <RowDefinition Height="27*" />
                <RowDefinition Height="28*" />
            </Grid.RowDefinitions>
            <xctk:PropertyGrid Grid.Row="1" SelectedObject="{Binding ElementName=grdStorages, Path=SelectedItem}" FontSize="11" MouseDoubleClick="PropertyGrid_MouseDoubleClick" Name="grdConfig"></xctk:PropertyGrid>

            <DataGrid AutoGenerateColumns="False" Name="grdStorages" Margin="0,0,0,3" ItemsSource="{Binding Storages, Source={x:Static DotNetSimaticDatabaseProtokollerLibrary:ProtokollerConfiguration.ActualConfigInstance}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserSortColumns="True">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="Storage-Name" Width="Auto" IsReadOnly="True" SortMemberPath="">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Name}" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Storage-Info" Width="Auto" IsReadOnly="True" SortMemberPath="ObjectAsString">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding ObjectAsString}" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
            <GridSplitter Grid.Row="0" Height="3" ResizeDirection="Rows" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"></GridSplitter>
        </Grid>
        <Button Content="Add Excel Storage" Height="25" HorizontalAlignment="Right" Margin="0,74,12,0" Name="cmdAddExcelStorage" VerticalAlignment="Top" Width="147" Click="cmdAddExcelStorage_Click" />
        <Button Content="Add Excel 2007 Storage" Height="25" HorizontalAlignment="Right" Margin="0,229,12,0" Name="cmdAddExcel2007Storage" VerticalAlignment="Top" Width="147" Click="cmdAddExcel2007Storage_Click" />
        <Button Content="Add Firebird Storage" Height="25" HorizontalAlignment="Right" IsEnabled="False" Margin="0,260,12,0" Name="button1" VerticalAlignment="Top" Visibility="Visible" Width="147" />
        <Button Content="Add Ingres Storage" Height="25" HorizontalAlignment="Right" IsEnabled="False" Margin="0,291,12,0" Name="button2" VerticalAlignment="Top" Visibility="Visible" Width="147" />
        <Button Content="Add PLC Storage" Height="25" HorizontalAlignment="Right" IsEnabled="True" Margin="0,336,12,0" Name="cmdAddPLCStorage" VerticalAlignment="Top" Visibility="Visible" Width="147" Click="cmdAddPLCStorage_Click" />
    </Grid>
</UserControl>
